<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="/plugin/bootstrap/css/bootstrap.css" />
    <link rel="stylesheet" href="/plugin/layui/css/layui.css" />
    <link rel="stylesheet" href="/plugin/swiper/swiper.min.css" />
    <link rel="stylesheet" href="/css/myAnimate.css" />
    <link rel="stylesheet" href="/css/common.css" />
    <link rel="stylesheet" href="/css/style.css" />
    <link rel="stylesheet" href="/css/animate.css" />
    <link rel="stylesheet" href="/css/fonts/iconfont.css" />
    <link
      rel="stylesheet"
      href="/plugin/bootstrap/dist/datepicker/datetimepicker.min.css"
    />
    <link rel="stylesheet" href="/plugin/bootstrap/dist/select/select.css" />
    <link rel="stylesheet" href="/plugin/summernote/summernote.css" />
    <link rel="stylesheet" href="/css/theme_red.css" />
    <script type="text/javascript" src="/js/jquery.js"></script>
    <script type="text/javascript" src="/js/Sortable.min.js"></script>
    <script type="text/javascript" src="/js/jquery-sortable.js"></script>
    <script
      type="text/javascript"
      src="/plugin/bootstrap/js/bootstrap.min.js"
    ></script>
    <script type="text/javascript" src="/plugin/layui/layui.js"></script>
    <script
      type="text/javascript"
      src="/plugin/bootstrap/dist/datepicker/datetimepicker.min.js"
    ></script>
    <script
      type="text/javascript"
      src="/plugin/bootstrap/dist/select/select.js"
    ></script>
    <script
      type="text/javascript"
      src="/plugin/summernote/summernote.min.js"
    ></script>
    <script type="text/javascript" src="/js/common.js"></script>
    <script type="text/javascript" src="../js/admin_common.js"></script>
  </head>

  <body class="child_body">
    <div class="comModal">
      <div class="searchBox">
        <div class="searchBtnBox flex clearfix">
          <div class="flex-1 flex">
            <div class="customForm flex m-r-5">
              <label>通报函号：</label>
              <input class="flex-1 form-control" placeholder="" />
            </div>
            <div class="customForm flex m-r-5">
              <label>下拉选择：</label>
              <div class="flex-1 w200">
                <select
                  class="selectpicker"
                  title="请选择"
                  onchange="selectChange(this)"
                >
                  <option value="1">Mustard</option>
                  <option value="2">Ketchup</option>
                  <option value="3">Barbecue</option>
                </select>
              </div>
            </div>
            <button
              type="button"
              class="btn btn-info btn-sm m-r-5"
              onclick="getParams()"
            >
              <span class="iconfont icon-search"></span>
              <span class="text">查询</span>
            </button>
            <button
              type="button"
              class="btn btn-default btn-sm m-r-10"
              onclick="resetSearch()"
            >
              <span class="iconfont icon-reset"></span>
              <span class="text">重置</span>
            </button>
            <div class="customForm pointer showMoreFilter">
              <span class="iconfont icon-filter"></span>
              <span>高级筛选</span>
            </div>
          </div>
          <div>
            <button
              type="button"
              disabled="disabled"
              class="btn btn-info btn-sm"
            >
              <span class="iconfont icon-submit"></span>
              <span class="text">批量完成</span>
            </button>
            <button
              type="button"
              class="btn btn-info btn-sm"
              onclick="showForm()"
            >
              <span class="iconfont icon-add-thin"></span>
              <span class="text">手工录入</span>
            </button>
            <button type="button" class="btn btn-info btn-sm">
              <span class="iconfont icon-import"></span>
              <span class="text">批量录入</span>
            </button>
            <button
              type="button"
              disabled="disabled"
              class="btn btn-info btn-sm"
            >
              <span class="iconfont icon-export"></span>
              <span class="text">导出通报函</span>
            </button>
            <button
              type="button"
              disabled="disabled"
              class="btn btn-danger btn-sm"
            >
              <span class="iconfont icon-delete"></span>
              <span class="text">删除</span>
            </button>
            <button type="button" class="btn btn-sm btn-disabled">
              <!-- <span class="iconfont icon-delete"></span> -->
              <span class="text">禁用</span>
            </button>
          </div>
        </div>
        <div class="searchForm form-inline row">
          <span class="searchFormClose iconfont icon-close-rs"></span>
          <div class="formItem col-md-4 flex">
            <label class="form-label">输入框</label>
            <input
              type="text"
              id="inputText"
              class="flex-1 form-control"
              placeholder="请输入用户名"
            />
          </div>
          <div class="formItem col-md-4 flex">
            <label class="form-label">下拉单选</label>
            <!--获取选中的值 $("#selectTest").selectpicker('val') -->
            <select
              id="selectTest"
              class="flex-1 selectpicker"
              title="请选择"
              onchange="selectChange(this)"
            >
              <option value="1">Mustard</option>
              <option value="2">Ketchup</option>
              <option value="3">Barbecue</option>
            </select>
          </div>
          <div class="formItem col-md-4 flex">
            <label class="form-label">下拉多选</label>
            <!-- <div id="selectTest" class="comSelectBox"></div> -->
            <!--获取选中的值 $("#selectMulTest").selectpicker('val') -->
            <select
              id="selectMulTest"
              class="flex-1 selectpicker"
              multiple
              title="请选择"
            >
              <option value="1">Mustard</option>
              <option value="2">Ketchup</option>
              <option value="3">Barbecue</option>
            </select>
            <!-- <select name="city" lay-verify="" multiple>
              <option value="">请选择一个城市</option>
              <option value="010">北京</option>
              <option value="021">上海</option>
              <option value="0571">杭州</option>
            </select> -->
          </div>
          <div class="formItem col-md-4 flex">
            <label class="form-label">时间选择</label>
            <div class="flex-1 fullWidth" id="datetimepicker"></div>
          </div>
          <div class="formItem col-md-4 flex">
            <label class="form-label">时间区间</label>
            <div id="comDateArea" class="comTimeRange flex-1 fullWidth"></div>
          </div>
        </div>
      </div>
      <div class="comNavBox flex p-l-r-15 m-t-15">
        <div class="flex-1">
          <ul class="nav nav-tabs flex-1">
            <li class="active" data-status="1">
              <a href="javascript:;">全部</a>
            </li>
            <li data-status="2"><a href="javascript:;">待审核</a></li>
            <li data-status="3"><a href="javascript:;">已审核</a></li>
          </ul>
        </div>
        <div class="inline text p-t-15 curPointer" onclick="setColumnDialog()">
          <span class="iconfont icon-settings"></span>&nbsp;&nbsp;列表设置
        </div>
      </div>
      <div class="p-l-r-15 p-b-15">
        <table
          class="layui-hide"
          id="bootstrapTable"
          lay-filter="bootstrapTable"
        ></table>
      </div>
    </div>
    <div class="flex m-t-15">
      <div class="comModal w300 m-r-15 p-15">
        <div class="treebox">放置tree</div>
      </div>
      <div class="comModal flex-1 p-15">
        <div>放置列表</div>
        <table
          class="layui-hide"
          id="layuiTreeTable"
          lay-filter="treeTable"
        ></table>
      </div>
    </div>
    <div id="testSideForm" class="sideForm hasFootBtn" style="width: 800px">
      <div class="sideFormHead">
        <span class="headText">新增</span>
        <span
          onclick="changeWinSize(this)"
          class="fullwin iconfont icon-quanping"
        ></span>
        <span
          class="closeSideForm iconfont icon-close-X"
          onclick="hideSideForm();"
        ></span>
      </div>
      <div class="myScroll">
        <div class="formModal sideFormModal">
          <div class="formHead flex">
            <div class="title flex-1">
              <span class="spanText">基础信息</span>
            </div>
            <div class="formHeadOper">
              <span class="iconfont icon-close-rs fs17 m-r-5"></span>
              <span
                class="operateView iconfont icon-more-right showMore"
              ></span>
            </div>
          </div>
          <div class="formBox">
            <div class="form-inline row">
              <div class="formItem col-md-6 flex">
                <label class="form-label w90">输入框</label>
                <div class="flex-1">
                  <input
                    type="text"
                    class="form-control"
                    placeholder="请输入用户名"
                  />
                </div>
              </div>
              <div class="formItem col-md-6 flex">
                <label class="form-label w90">日期</label>
                <div class="flex-1">
                  <div id="formDatePicker"></div>
                </div>
              </div>
              <div class="formItem col-md-6 flex">
                <label class="form-label w90">日期区间</label>
                <div class="flex-1">
                  <div id="formDateAreaPicker"></div>
                </div>
              </div>
              <div class="formItem col-md-6 flex">
                <label class="form-label w90">备注</label>
                <div class="flex-1">
                  <textarea
                    class="form-control"
                    placeholder="请输入用户名"
                  ></textarea>
                </div>
              </div>
              <div class="formItem col-md-12 flex">
                <label class="form-label w90">副文本</label>
                <div class="flex-1">
                  <div id="myEditer"></div>
                </div>
              </div>
              <div class="formItem col-md-12 flex">
                <label class="form-label w90">上传图片</label>
                <div class="flex-1">
                  <ul class="picListBox" id="myPicList">
                    <li class="item fileItem">
                      <span class="iconfont icon-add-wide"></span>
                      <input type="file" onchange="fileChange(this)" />
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="sideFootBtn text-right">
        <button class="btn btn-default m-r-15" onclick="hideSideForm();">
          取消
        </button>
        <button class="btn btn-info m-r-15" onclick="hideSideForm();">
          确认
        </button>
      </div>
    </div>
    <!-- <div id="columnDialog" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document" style="width: 1000px">
        <div class="modal-content" style="width: 1000px">
          <div class="modal-header">
            <button
              type="button"
              class="close"
              data-dismiss="modal"
              aria-label="Close"
            >
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">自定义列</h4>
          </div>
          <div class="modal-body">
            <div class="columnsBox m-b-15">
              <div class="title">显示列</div>
              <ul id="sortable-1">
                <li class="dragItem default inline" draggable="true">
                  Product 1
                </li>
                <li class="dragItem default inline" draggable="true">
                  Product 2
                </li>
                <li class="dragItem default inline" draggable="true">
                  Product 3
                </li>
                <li class="dragItem default inline" draggable="true">
                  Product 4
                </li>
                <li class="dragItem default inline" draggable="true">
                  Product 5
                </li>
                <li class="dragItem default inline" draggable="true">
                  Product 6
                </li>
                <li class="dragItem default inline" draggable="true">
                  Product 7
                </li>
                <li class="dragItem default inline" draggable="true">
                  Product 8
                </li>
              </ul>
            </div>
            <div class="columnsBox">
              <div class="title">隐藏列</div>
              <ul id="sortable-2"></ul>
            </div>
          </div>
          <div class="modal-footer border0">
            <button
              type="button"
              class="cancel btn btn-default"
              data-dismiss="modal"
            >
              取消
            </button>
            <button
              type="button"
              class="confirm btn btn-info"
              onclick="getData()"
            >
              确认
            </button>
          </div>
        </div>
      </div>
    </div> -->
    <div id="columnDialog" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document" style="width: 1000px">
        <div class="modal-content" style="width: 1000px">
          <div class="modal-header">
            <button
              type="button"
              class="close"
              data-dismiss="modal"
              aria-label="Close"
            >
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">自定义列</h4>
          </div>
          <div class="modal-body">
            <div class="columnsBox m-b-15">
              <div class="title">显示列</div>
              <ul id="sortable-1">
                <li class="default inline">Product 1</li>
                <li class="default inline">Product 2</li>
                <li class="default inline">Product 3</li>
                <li class="default inline">Product 4</li>
                <li class="default inline">Product 5</li>
                <li class="default inline">Product 6</li>
                <li class="default inline">Product 7</li>
                <li class="default inline">Product 8</li>
              </ul>
            </div>
            <div class="columnsBox">
              <div class="title">隐藏列</div>
              <ul id="sortable-2"></ul>
            </div>
          </div>
          <div class="modal-footer border0">
            <button
              type="button"
              class="cancel btn btn-default"
              data-dismiss="modal"
            >
              取消
            </button>
            <button
              type="button"
              class="confirm btn btn-info"
              onclick="getData()"
            >
              确认
            </button>
          </div>
        </div>
      </div>
    </div>
  </body>
  <script type="text/html" id="barDemo">
    <span class="layuiTableOperItem disabled">查看</span>
    <!-- <span class="layuiTableOperItem">编辑</span>
    <span class="layuiTableOperItem">提交</span> -->
    <!-- <a class="tableMoreOper" data-id="909369135582511104">
      <span>
        <i class="iconfont icon-more-ellipsis"></i>
      </span>
      <ul class="tableOperList">
        <li class="item" onclick="opertShow({{d.id}})">
          <span class="iconfont icon-user m-r-10"></span>
          <span class="text">操作2</span>
        </li>
        <li class="item border-top">
          <span class="iconfont icon-exit m-r-10"></span>
          <span class="text">操作1</span>
        </li>
      </ul>
    </a> -->
    {{# if(d.id == 1001){ }}
    <a
      class="btn btn-info btn-xs m-l-r-10"
      data-row="{{JSON.stringify(d)}}"
      onclick="detailView(this)"
      >查看</a
    >
    {{# } else { }}
    <a class="tableMoreOper" data-id="909369135582511104">
      <span class="btn btn-default btn-xs">
        <i class="iconfont icon-more-ellipsis"></i>
      </span>
      <ul class="tableOperList">
        <li class="item" onclick="opertShow({{d.id}})">
          <span class="iconfont icon-user m-r-10"></span>
          <span class="text">操作2</span>
        </li>
        <li class="item border-top">
          <span class="iconfont icon-exit m-r-10"></span>
          <span class="text">操作1</span>
        </li>
      </ul>
    </a>
    {{# } }}
  </script>
  <script>
    $(function () {
      bindSelectEvent();
      bindComEvent();
      layui
        .config({
          base: "../plugin/layui/",
        })
        .extend({
          treetable: "/treeTable",
        })
        .use(["treeTable"], function () {
          var treeTable = layui.treeTable;
          //文档地址
          //https://blog.csdn.net/qq_42374233/article/details/124288568
          var data = [
            {
              id: "1",
              name: "xxx",
              createTime: "2019/11/18 10:44:00",
              children: [
                {
                  id: "1_1",
                  name: "xxx",
                  createTime: "2019/11/18 10:44:00",
                  children: [
                    {
                      id: "1_1_1",
                      name: "yyy",
                      createTime: "2019/11/18 10:44:00",
                    },
                  ],
                },
              ],
            },
            {
              id: "2",
              name: "xxx",
              createTime: "2019/11/18 10:44:00",
              children: [
                {
                  id: "2_1",
                  name: "xxx",
                  state: 0,
                  createTime: "2019/11/18 10:44:00",
                  children: [
                    {
                      id: "2_1_1",
                      name: "yyy",
                      state: 0,
                      createTime: "2019/11/18 10:44:00",
                      children: [],
                    },
                  ],
                },
              ],
            },
          ];

          // 渲染表格
          var insTb = treeTable.render({
            elem: "#layuiTreeTable",
            data: data, // 数据
            tree: {
              iconIndex: 1, // 折叠图标显示在第几列
              getIcon: function (d) {
                if (d.haveChild) {
                  // 判断是否有子集
                  return ""; //'<i class="ew-tree-icon ew-tree-icon-folder"></i>
                } else {
                  return ""; //<i class="ew-tree-icon ew-tree-icon-file"></i>
                }
              },
            },

            cols: [
              { type: "checkbox" },
              { field: "id", title: "ID" },
              { field: "name", title: "name" },
              { field: "createTime", title: "创建时间" },
            ],
          });
        });
      // $.comSelect({
      //   id: "selectTest",
      //   type: "checkbox", //或者Radio
      //   data: [
      //     { id: 1001, name: "账单" },
      //     { id: 1002, name: "文档" },
      //   ],
      // });
      //tab点击
      $(".nav-tabs li")
        .off("click")
        .on("click", function () {
          var status = $(this).data("status");
          console.log(status);
          $(this).addClass("active").siblings().removeClass("active");
        });
      $("#datetimepicker").datePicker({
        dateType: "date",
        format: "datetime",
      });
      $("#comDateArea").datePicker({
        dateType: "daterange",
        format: "datemin",
        rangeValue: ["2023-12-30 12:20", "2023-12-30 13:20"],
      });
      // $("#datetimeArea").datetimepicker({
      //   language: "zh-CN",
      // });
      // 初始化表格,动态从服务器加载数据
      $.layuiTable({
        id: "bootstrapTable",
        done: bindTableEvent,
        cols: [
          //表头
          { type: "checkbox", fixed: "left" },
          {
            field: "id",
            title: "ID",
            width: 80,
            sort: true,
            fixed: "left",
            totalRowText: "合计：",
          },
          {
            field: "username",
            title: "用户名",
            width: 80,
            templet: function (d) {
              return "<span class='cellTip'>" + d.username + "</span>";
            },
          },
          {
            field: "experience",
            title: "积分",
            sort: true,
            totalRow: true,
            width: "10%",
          },
          {
            field: "sex",
            title: "性别",
            sort: true,
            width: "10%",
            templet: function (d) {
              var _class = "blue";
              if (d.LAY_INDEX % 2 == 1) {
                _class = "gray";
              }
              return '<span class="mainColorBox ' + _class + '"></span>';
            },
          },
          {
            field: "score",
            title: "评分",
            sort: true,
            width: "10%",
            totalRow: "{{ parseInt(d.TOTAL_NUMS) }} 分",
            templet: function () {
              return '<div class="flex items-center fullHeight"><div class="comSwitch switchRound off"></div></div>';
            },
          },
          { field: "city", title: "城市" },
          { field: "sign", title: "签名" },
          { field: "classify", title: "职业" },
          {
            field: "wealth",
            title: "财富",
            width: 135,
            sort: true,
            totalRow: true,
          },
          {
            fixed: "right",
            title: "操作",
            width: 220,
            align: "center",
            toolbar: "#barDemo",
            //templet: function (row) {
            //  return initTableOper(row);
            //},
          },
        ],
        data: [
          { username: "test1", id: 1001 },
          { username: "test2", id: 1002 },
        ],
        done: function (res, layuiTable) {
          //addTotalRow("bootstrapTable", layuiTable);
        },
      });
      // setTimeout(() => {
      //   $.myAlert({
      //     message: "测试我的内同",
      //   });
      // }, 2000);
      setDefaultVal();
      setTimeout(function () {
        getParams();
      }, 5000);
    });
    //新增一行
    function addTotalRow(tableId, layuiTable) {
      var $tablemain = $("div[lay-id='" + tableId + "']").find(
        ".layui-table-main"
      );
      var $fixleft = $("div[lay-id='" + tableId + "']").find(
        ".layui-table-fixed-l"
      );
      var $fixright = $("div[lay-id='" + tableId + "']").find(
        ".layui-table-fixed-r"
      );
      if ($tablemain.length) {
        var tr = $tablemain.find('tr[data-index="0"]');
        $tablemain.find('tr[data-index="0"]').before(
          `<tr class="">
              <td data-field="0" data-key="1-0-0" class="layui-table-col-special">
                <div class="layui-table-cell laytable-cell-1-0-0 laytable-cell-checkbox">
                  <input type="checkbox" name="layTableCheckbox" lay-skin="primary">
                  <div class="layui-unselect layui-form-checkbox" lay-skin="primary">
                    <i class="layui-icon layui-icon-ok"></i></div></div>
              </td>
              <td data-field="id" class="">
                <div class="layui-table-cell laytable-cell-1-0-1">1008</div>
              </td>
              <td data-field="username" class="">
                <div class="layui-table-cell">
                  5254
                </div>
              </td>
              <td data-field="experience" class="">
                <div class="layui-table-cell">545</div>
              </td>
              <td data-field="sex" data-content="" class="">
                <div class="layui-table-cell">
                 885989
                </div>
              </td>
              <td data-field="score" class="">
                <div class="layui-table-cell">
                  98855
                </div>
              </td>
              <td data-field="city" class="">
                <div class="layui-table-cell">33</div>
              </td>
              <td data-field="sign" class="">
                <div class="layui-table-cell">22</div>
              </td>
              <td data-field="classify" class="">
                <div class="layui-table-cell">12</div>
              </td>
              <td data-field="wealth" class="">
                <div class="layui-table-cell">ddd</div>
              </td>
              <td data-field="10">
                <div class="layui-table-cell">总计：1180</div>
              </td>
            </tr>`
        );
        layuiTable.reload(tableId);
      }
    }
    //自定义列
    function setColumnDialog() {
      $("#columnDialog").on("show.bs.modal", function () {
        // 拖拽排序
        var sortable1 = document.getElementById("sortable-1");
        var sortable2 = document.getElementById("sortable-2");
        var ops = {
          group: "shared",
          animation: 150,
        };
        //初始化
        var sortable1 = Sortable.create(sortable1, ops);
        var sortable2 = Sortable.create(sortable2, ops);
      });
      $("#columnDialog").modal("show");
    }
    function setColumnDialog_old() {
      $("#columnDialog").on("show.bs.modal", function () {
        const list = document.getElementById("sortable-1");

        list.addEventListener("dragstart", function (e) {
          e.target.style.opacity = "0.4";
        });

        list.addEventListener("dragover", function (e) {
          e.preventDefault();
        });

        list.addEventListener("dragenter", function (e) {
          e.target.style.border = "1px dashed #ccc"; // Visual feedback for before drop
        });

        list.addEventListener("dragleave", function (e) {
          e.target.style.border = ""; // Remove visual feedback
        });

        list.addEventListener("drop", function (e) {
          const draggedItem = e.target; // Get the dragged element
          const listItems = Array.from(list.children); // Get all list items
          const draggedItemIndex = listItems.indexOf(draggedItem); // Get dragged item index
          const dropIndex = listItems.indexOf(e.target); // Get drop index

          // Reorder the list
          listItems.splice(
            dropIndex,
            0,
            listItems.splice(draggedItemIndex, 1)[0]
          );

          // Update the list order
          listItems.forEach(
            (item, index) => (item.innerHTML = `Item ${index + 1}`)
          );

          e.preventDefault(); // Prevent default action (open as link for some elements)
        });

        list.addEventListener("dragend", function (e) {
          e.target.style.opacity = "1"; // Reset the element opacity
          e.target.style.border = ""; // Remove visual feedback
        });
        // 拖拽排序
        /*var sortable1 = document.getElementById("sortable-1");
        var sortable2 = document.getElementById("sortable-2");
        var ops = {
          group: "shared",
          animation: 150,
        };
        //初始化
        var sortable1 = Sortable.create(sortable1, ops);
        var sortable2 = Sortable.create(sortable2, ops);*/
        /*document
          .querySelector("#columnDialog")
          .addEventListener("dragstart", function (event) {
            event.stopPropagation();
          });*/
      });
      $("#columnDialog").modal("show");
    }
    //给组件 赋值
    function setDefaultVal() {
      $("#inputText").val("测试");
      //下拉选择赋值
      $("#selectTest").selectpicker("val", "1");
      $("#selectMulTest").selectpicker("val", [1, 2]);
      //日期赋值
      $("#datetimepicker").setDatePickeValue("2024-04-27 18:30");
      $("#comDateArea").setDatePickeValue([
        "2024-04-27 18:30",
        "2024-04-27 20:30",
      ]);
    }
    //search form取值
    function getParams() {
      var params = {};
      //输入框
      params.name = $("#inputText").val();
      //下拉选择
      params.select1 = $("#selectTest").selectpicker("val");
      params.select2 = $("#selectMulTest").selectpicker("val");
      //时间
      params.dateTime = $("#datetimepicker").getDatePickeValue();
      params.dateRange = $("#comDateArea").getDatePickeValue();
      console.log(params);
    }
    //重置
    function resetSearch() {
      $("#inputText").val("");
      //下拉选择清除
      $("#selectTest").selectpicker("val", "");
      $("#selectMulTest").selectpicker("val", "");
      //日期
      $("#datetimepicker").setDatePickeValue("");
      $("#comDateArea").setDatePickeValue([]);
    }
    //自定义操作
    function initTableOper(row) {
      var oper =
        '<div class="flex items-center layuiTableOper">' +
        '<div class="btn btn-xs btn-primary m-r-10 pwdReset" onclick="detailView(this)" title="重置密码" data-row=' +
        JSON.stringify(row) +
        '><i class="glyphicon glyphicon-pencil"></i></div>' +
        '<div class="btn btn-xs btn-success disableBtn m-r-10" onclick="opertShow(' +
        row.id +
        ')" title="禁用/启用">' +
        '<i class="glyphicon glyphicon-user"></i></div>' +
        '<div class="btn btn-xs btn-danger delBtn" title="删除">' +
        '<i class="glyphicon glyphicon-trash"></i></div>' +
        '<div class="moreOper tableMoreOper" title="更多">' +
        '<span class="btn btn-xs btn-default"><i class="iconfont icon-more-ellipsis"></i></span>' +
        '<ul class="tableOperList">' +
        '<li class="item" onclick="opertShow(' +
        row.id +
        ')">' +
        '<span class="iconfont icon-user m-r-10"></span>' +
        '<span class="text">操作2</span>' +
        "</li>" +
        '<li class="item border-top">' +
        '<span class="iconfont icon-exit m-r-10"></span>' +
        '<span class="text">操作1</span>' +
        "</li>" +
        "</ul>" +
        "</div></div>";
      return oper;
    }
    //事件绑定
    function bindTableEvent() {
      $(".comSwitch").length &&
        $(".comSwitch")
          .off("click")
          .on("click", function () {
            $(this).toggleClass("on");
            $(this).toggleClass("off");
          });
      //自定义绑定
      $(".layui-table-view[lay-id=bootstrapTable] .tableMoreOper").hover(
        function (event) {
          var offset = $(this).offset();
          console.log(event);
          var xPos =
            event.pageX - 140 - event.offsetX + $(event.currentTarget).width();
          var yPos = event.pageY + 22 - event.offsetY + 10; //10是padding-top的值
          $(this)
            .children("ul")
            .css({ left: xPos + "px", top: yPos + "px" })
            .show();
        },
        function () {
          $(this).children("ul").hide();
        }
      );
      var tipInd, mylayer;
      $(".cellTip").hover(
        function () {
          var that = this;
          layui.use("layer", function () {
            mylayer = layer;
            tipInd = layer.tips("只想提示地精准些", that);
          });
        },
        function () {
          mylayer.close(tipInd);
        }
      );
      /*.off("click")
        .on("click", function () {
          var that = this;
          tipInd =  layui.use("layer", function () {
            layer.tips("只想提示地精准些", that);
          });
        });*/
    }
    /*表格操作*/
    function detailView(obj) {
      var row = $(obj).data("row");
      alert(row.id);
    }
    function opertShow(id) {
      alert(id);
    }

    function operateFormatter(value, row, index) {
      //添加按钮
      var rows = JSON.stringify(row);
      // 根据传过来的参数添加不同的class
      var classED = "enabledE";
      var classEDVal;
      if (row.status == "启用") {
        classED = "enabledD";
        classEDVal = "禁用";
      } else {
        classED = "enabledE";
        classEDVal = "启用";
      }
      // onclick=modif(' + value + "," + rows + "," + index + ')
      return [
        // '<div class="flex justify-center">' +
        // <div class="btn btn-xs btn-primary m-r-10 pwdReset" title="重置密码" table-data=' +
        // //   rows +
        // ><i class="glyphicon glyphicon-pencil"></i></div>',
        // // '<div class="btn btn-xs btn-success disableBtn m-r-10" title="禁用/启用">' +
        // <i class="glyphicon glyphicon-user"></i></div>' +
        // <div class="btn btn-xs btn-danger delBtn m-r-10" title="删除">' +
        // <i class="glyphicon glyphicon-trash"></i></div>' +
        // <div class="moreOper" title="更多">' +
        // <span class="btn btn-xs btn-default"><i class="iconfont icon-more-ellipsis"></i></span>' +
        // <ul class="tableOperList">' +
        // <li class="item" onclick="changePassWord()">' +
        // <span class="iconfont icon-user m-r-10"></span>' +
        // <span class="text">操作2</span>' +
        //   "</li>" +
        // <li class="item border-top">' +
        // <span class="iconfont icon-exit m-r-10"></span>' +
        // <span class="text">操作1</span>' +
        //   "</li>" +
        //   "</ul>" +
        // //   "</div></div>",
        '<a href="javascript:;" class="link m-r-10">查看</a>' +
          '<a href="javascript:;" class="link m-r-10">导出通报函</a>' +
          '<a href="javascript:;" class="link m-r-10">上传通报函</a>' +
          '<a href="javascript:;" class="link dispath">派发</a>',
      ].join("");
    }
    function getSelection() {
      console.log($("#bootstrapTable").bootstrapTable("getAllSelections"));
    }
    function selectChange(obg) {}
    function showForm() {
      $("#testSideForm").fadeIn().css("right", "15px");
      //头部右侧展示更多
      $(".operateView")
        .off("click")
        .on("click", function () {
          if ($(this).hasClass("showMore")) {
            $(this).removeClass("showMore").addClass("hideMore");
          } else {
            $(this).removeClass("hideMore").addClass("showMore");
          }
          $(this).parents(".formHead").next(".formBox").fadeToggle();
        });
      //富文本销毁
      $("#myEditer").summernote("destroy");
      //初始化
      $("#myEditer").summernote({
        height: 300,
        width: "100%",
        tabsize: 2,
        placeholder: "请输入",
        lang: "zh-CN",
        callbacks: {
          onImageUpload: function (files) {
            sendFile(files);
          },
        },
      });
      //获取值
      //   $("#myEditer").summernote("code");
      //主动赋值
      $("#myEditer").summernote("code", "<h3>测试</h3>");
      $("#formDatePicker").datePicker({
        dateType: "date",
        format: "date",
      });
      $("#formDateAreaPicker").datePicker({
        dateType: "daterange",
        format: "date",
      });
    }
    function hideSideForm() {
      $("#testSideForm").fadeOut().css("right", "-50%");
    }
    function fileChange(e) {
      preview(e, "myPicList", true);
    }
    function fileUploadChange(e) {
      InitFileView(e, "fileUploadTest");
      $("#fileUploadTest .iconfont")
        .off("click")
        .on("click", function () {
          $(this).siblings(".name").text("");
          $(this).parent(".fileName").hide().siblings(".btn").show();
        });
    }
  </script>
</html>
